package com.sk.sqd;

import lombok.Data;

import java.util.List;

/**
 * 将一个接收者绑定于一个动作，调用接收者执行相应的操作
 */
@Data
public class ConcreteCommand implements Command {

    /**
     * 命令接收对象
     */
    protected List<Receiver> receiverList;

    @Override
    public void execute() {
        receiverList.forEach(Receiver::action);
    }
}
